<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>个案信息查询管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
	$(document).ready(function() {
		//$("#name").focus();
		$("#inputForm").validate({
			submitHandler: function(form){
				loading('正在提交，请稍等...');
				form.submit();
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
					error.appendTo(element.parent().parent());
				} else {
					error.insertAfter(element);
				}
			}
		});
		$(document).on("click","#check",function(){
			debugger;
			var batchNo = $(this).parent().parent().attr("data-batchNo");
			var index = batchNo.indexOf("-");
			if(index >= 0){
				batchNo = batchNo.substring(0,batchNo.indexOf("-"))
			}
			var url = "${ctx}/area/vaccinate/queryLocation?vaccineId="+$(this).parent().parent().attr("data-vaccineId")
				+"&companyCode="+$(this).parent().parent().attr("data-companyCode")
				+"&batchNo="+batchNo
				+"&layer=true";
	    	parent.layer.open({
				type : 2,
				title : '疫苗出入库流向图',
				shadeClose : true,
				shade : 0.8,
				maxmin: true,
				success: function(layero,index){
			        //在回调方法中的第2个参数“index”表示的是当前弹窗的索引。通过parent.layer.full方法将窗口放大。
			        parent.layer.full(index);
			    },
				area : [screen.availWidth * 0.7 + 'px', screen.availHeight * 0.6 + 'px' ],
				content : url
			});
	    });
	});
	function closeLayer(){
		var index=parent.layer.getFrameIndex(window.name);
		parent.layer.close(index);
	}
</script>
<style type="text/css">
.minWidth {
	min-width: 500px;
}
@media ( min-width : 789px) and (max-width: 1098px) {
	.secondChild {
		margin-left: 0
	}
}
@media print {
    .noprint{visibility:hidden}
}
.ib{
	display: block;
	float: left;
}
.col-sm-3,.col-sm-4,.col-sm-5{
    float: left;
}
.col-sm-5 {
     width: 50%;
}
.col-sm-4 {
     width: 50%;
}
.col-sm-3 {
     width: 25%;
}
</style>
<style type="text/css">
.col-sm-5{
	width: 65%;
}
.text-right{
	text-align: right;
}
#div{
	margin-left: 100px;
}
#recordTbody td ,#recordTbody th{
	text-align: center;
	padding: 2px 2px;
}
</style>
</head>
<body>
	<ul class="nav nav-tabs">
<%-- 		<li class="active"><a href="${ctx}/child/childBaseinfo/form?id=${childBaseinfo.id}">个案信息查询<shiro:hasPermission name="child:childBaseinfo:edit">${not empty childBaseinfo.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="child:childBaseinfo:edit">查看</shiro:lacksPermission></a></li> --%>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="childBaseinfo" action="${ctx}/child/childBaseinfo/save" method="post" class="form-horizontal">
		<form:hidden path="id"/> 
		<sys:message content="${message}"/>
		<div class="col-sm-3" style="padding: 5px">
			<sys:message content="${message}" />
				<table class="table table-striped table-bordered table-condensed">
				<caption style="font-size: 1.8em; text-align:center;padding:10px 0px;">儿童基本信息</caption>
					<thead>
						<tr>
							<td style="width: 100px; text-align: right" class="text-right">儿童编码</td>
							<td>${childBaseinfo.childcode}</td>
						</tr>
						<tr>
							<td class="text-right" style="text-align: right">儿童身份证</td>
							<td>${childBaseinfo.cardcode}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">出生证号</td>
							<td>${childBaseinfo.birthcode}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">儿童姓名</td>
							<td>${childBaseinfo.childname}<c:if test="${not empty childBaseinfo.mouage}"><span style="color: red; font-weight: bold;">(${childBaseinfo.mouage 	})</span></c:if></td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">性&emsp;&emsp;别</td>
							<td>${fns:getDictLabel(childBaseinfo.gender, 'sex', '')}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">出生日期</td>
							<td><fmt:formatDate value="${childBaseinfo.birthday}"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">出生医院</td>
							<td>${childBaseinfo.birthhostipal}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">出生体重(g)</td>
							<td>${childBaseinfo.birthweight}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">区域划分</td>
							<td>${childBaseinfo.area}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">母亲姓名</td>
							<td>${childBaseinfo.guardianname}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">手机号码</td>
							<td>${childBaseinfo.guardianmobile}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">母亲身份证</td>
							<td>${childBaseinfo.guardianidentificationnumber}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">家庭住址</td>
							<td>${childBaseinfo.homeaddress}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">户籍地址</td>
							<td>${childBaseinfo.registryaddress}</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">接种单位</td>
							<td>
								<%-- <c:if test="${childBaseinfo.officeinfo == '淮海路接种门诊'}">${childBaseinfo.officeinfo}</c:if>
								<c:if test="${childBaseinfo.officeinfo != '淮海路接种门诊'}">
								</c:if> --%>
								<span style="color: red; font-weight: bold;">${childBaseinfo.officeinfo}</span>
							</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">在册情况</td>
							<td>
							   <c:if test="${childBaseinfo.situation == '1'}">
							       ${fns:getDictLabel(childBaseinfo.situation, 'child_situation', '')}
							   </c:if>
							   <c:if test="${childBaseinfo.situation != '1'}">
							       <span style="color: red; font-weight: bold;">
							          ${fns:getDictLabel(childBaseinfo.situation, 'child_situation', '')}
							       </span>
							   </c:if>
							</td>
						</tr>
						<tr>
							<td class="text-right"  style="text-align: right">备注</td>
							<td>${childBaseinfo.remarks}</td>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
				<div class="pull-right noprint">
		           <input onclick="print()" class="btn btn-primary" type="button" value="打印"/>
		           <input type="button" class="btn btn-primary"  value="关闭窗口" onclick ="closeLayer()"/>
			</div>
			</div>
			<div class=" col-sm-5 " style="padding: 5px">
				<sys:message content="${message}" />
				<table class="table  table-bordered table-condensed">
					<caption style="font-size: 1.8em; text-align:center;padding:10px 0px;">已接种疫苗</caption>
					<thead>
						<tr>
						<!--	<th >疫苗种类</th> -->
							<th width="16%" style="text-align:center;">接种单位</th>
							<th style="text-align:center">接种医生</th>
							<th style="text-align:center;width: 18%">疫苗名称</th>
							<th style="text-align:center">批号</th>
							<th width="12%" style="text-align:center">生产厂商</th>
							<!-- <th>疫苗价格</th> -->
							<th width="10%" style="text-align:center">针次</th>
							<th style="text-align:center">接种部位</th>
							<th style="text-align:center">疫苗价格</th>
							<th width="10%" style="text-align:center">接种日期</th>
<!-- 							<th><span class="ib">接种</span><span class="ib">部位</span></th> -->
						</tr>
					</thead>
					<tbody id="recordTbody">
					    <c:forEach items="${childVaccRecord}" var="childVaccRecord">
							<tr  data-vaccineId="${childVaccRecord.vaccineId}" data-companyCode="${childVaccRecord.companyCode}" data-batchNo="${childVaccRecord.batch}" 
							data-storeCode="${childVaccRecord.storeCode}" data-name="${childVaccRecord.storeName}">
								<td>	 
								    ${childVaccRecord.storeName}
								</td>
								<td>	 
								    ${childVaccRecord.doctor}
								</td>
							    <td>
									${childVaccRecord.vaccName}
								</td>
							    <td>
							        <a href="javascript:;" id ="check">${childVaccRecord.batch}</a>
								</td>
								<td>	 
								    ${childVaccRecord.companyName}
								</td>
								<td>
									${fns:getDictLabel(childVaccRecord.dosage, "pin", "")}
								</td>
								<td>
									${fns:getDictLabel(childVaccRecord.bodyPart, "position", "")}
								</td>
								<td style = "text-align: right; padding-right: 10px">
									￥${childVaccRecord.price}
								</td>
								<td>
								    <fmt:formatDate value="${childVaccRecord.vaccinateDate}" pattern="yyyy/MM/dd"/>
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
	</form:form>
</body>
</html>